package com.ilop.sthome.mvp.contract.scene;

import android.content.Intent;

import com.example.common.mvp.IBasePresenter;
import com.example.common.mvp.IBaseView;
import com.ilop.sthome.data.greenDao.AutomationBean;
import com.ilop.sthome.data.greenDao.DeviceInfoBean;

import java.util.List;

/**
 * @author skygge
 * @date 2020-01-12.
 * GitHub：javofxu@github.com
 * email：skygge@yeah.net
 * description：自动化详情页面
 */
public interface AutomationContract {

    interface IView extends IBaseView{

        void showIsDefault(boolean editable);

        void showWhetherToSave();

        void showSaveUnableToClick();

        void showInputList(List<DeviceInfoBean> deviceList);

        void showOutputList(List<DeviceInfoBean> deviceList);

        void startActivityByIntent(Intent intent);

        void showToastMsg(String msg);

        void finishActivity();
    }

    interface IPresent extends IBasePresenter<IView>{

        void isDefault(AutomationBean auto);

        void isNewForShow(AutomationBean mAuto);

        void isModifyForShow(boolean modify, AutomationBean mAuto);

        void setInputList(List<DeviceInfoBean> deviceList);

        void setOutputList(List<DeviceInfoBean> deviceList);

        boolean isTimerOrClick();

        boolean isTimer();

        void addNewInput();

        void addNewOutput();

        void updateAction(boolean isInput, int position);

        void deleteCondition(boolean isInput);

        void onSaveAutomation();

        void onDeleteAutomation(int sceneId);

        void sendSuccess(String autoId);

        void deleteSuccess();

        boolean checkContent();

        boolean checkInput(DeviceInfoBean device);

        boolean checkOutput(DeviceInfoBean device);

        void checkUpdateInput(DeviceInfoBean device);

        void checkUpdateOutput(DeviceInfoBean device);

        void whetherToSave(boolean hasModify);
    }

}
